<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
	"http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>myweb</title>
		
		<style type="text/css">
			#contentDiv {
				width: 800px;
				font-size: 12px;
				margin: 100px auto 0;
				text-align: center;
			}
			
			#burDiv {
				width: 100%;
				height: 30px;
				font-size: 12px;
				margin: 0 auto;
				background-color: #eeeeee;
				float: left;
			}
		</style>
		
		<script type="text/javascript">
			function add() {
				window.location.href="toAddPerson.action";
			}

			function logOut() {
				window.location.href="logOut.action";
			}
		</script>
	</head>
	<body>
	
		<div id="contentDiv">
	
			<div id="burDiv">
				<s:form action="queryPerson" method="post">
					<span style="float:left;">
						姓名 <input type="text" name="condition.name" value=""/>
						年龄 <input type="text" name="condition.age" value="" />
						财富 <input type="text" name="condition.money" value="" />
						<input type="submit" value="查询">
					</span>
					<span style="float:right;">
						<input type="button" value="新增" onclick="javascript:add()">
						<input type="button" value="退出" onclick="javascript:logOut()">
					</span>
				</s:form>
			</div>
	
			<div style="width:100%; margin:20px auto 0; float:left;">
				<table style="width:100%; text-align:center;" align="center" border="1" cellpadding="0" cellspacing="0">
					<tr style="background-color:#DFDFDF;">
						<td style="height:25px;width:25%;">名字</td>
						<td style="width:25%;">年龄</td>
						<td style="width:25%;">财富</td>
						<td style="width:25%;">操作</td>
					</tr>
					
					<s:if test="list.size eq 0">
						<tr style="background-color:#ffffff;"  onmouseover="style.backgroundColor='yellow'" 
	    					onmouseout="style.backgroundColor='#ffffff'">
							<td colspan="4" style="height:25px;">没有查到相关数据</td>
						</tr>
					</s:if>
					<s:else>
						<s:iterator value="list" status="st">
							<s:if test="#st.odd">
								<tr style="background-color:#eeeeee;"  onmouseover="style.backgroundColor='yellow'" 
	    							onmouseout="style.backgroundColor='#eeeeee'">
							</s:if>
							<s:else>
								<tr style="background-color:#ffffff;"  onmouseover="style.backgroundColor='yellow'" 
	    							onmouseout="style.backgroundColor='#ffffff'">
							</s:else>
								
								<td style="height:25px;"><s:property value="name" /></td>
								<td><s:property value="age" /></td>
								<td><s:property value="money" /></td>
								
								<td>
									<a href="deletePerson.action?id=<s:property value='id'/>">删除</a>
									<a href="toUpdatePerson.action?id=<s:property value='id'/>">修改</a>
								</td>
							</tr>
						</s:iterator>
					</s:else>
				</table>
			</div>
		</div>
	</body>
</html>